package com.example.boot1.conttoller;

import com.example.boot1.bean.User;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;


@RestController
@Api(tags = "springboot学习工程相关接口")
public class UserController2 {

    @ApiOperation("通过名称查询用户接口")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "name", value = "名字")
    })
    @ResponseBody
    @RequestMapping("/select2")
    public String select(@RequestParam("name") String username){
        System.out.println("---select---name---"+username);
        return "selcet:ok!";
    }

    @ResponseBody
    @RequestMapping("/saveArrR")
    public String saveArrR(@RequestBody  User user){
        if (null!= user ){
            System.out.println(user.getInterests().toString());
        }
        return "save arr2 success!";
    }
}
